//
//  main.cpp
//  testOGL
//
//  Created by lichenyang on 15/2/25.
//  Copyright (c) 2015年 lichenyang. All rights reserved.
//

#include <iostream>
#include <OpenGL/glu.h>
#include <OpenGL/OpenGL.h>
#include <GLUT/glut.h>

void display()
{
    glColor3f( 1.0, 0, 0);
    glBegin(GL_LINE_LOOP);
    glVertex2i(0, 0);
    glColor3f( 0.0, 1.0, 0);
    glVertex2i(100, 100);
    glColor3f( 0.0, 0.0, 1.0);
    glVertex2i(100, 150);
    glEnd();
    glFlush();
}

void init()
{
	glClear(GL_COLOR_BUFFER_BIT);
//	glLineWidth(5);
    glMatrixMode(GL_PROJECTION);
    gluOrtho2D(0.0, 200, 0.0, 150);
}

int main(int argc, const char * argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
    glutInit(&argc, (char**)argv);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutInitWindowPosition(50, 100);
    glutInitWindowSize(400, 300);
    glutCreateWindow("my Glut windows");
    
    init();
    glutDisplayFunc(display);
    glutMainLoop();
    return 0;
}
